package org.wattdepot.cli.command;

import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import static org.junit.Assert.assertTrue;

/**
 * Test case for dailysensor command.
 * 
 * @author Owner
 * 
 */
public class TestDailySensorCommand {

  /**
   * Tests if dailysensordata command returns beginning and ending data for a known source.
   */
  @Test
  public void testCorrectOutput() {
    List<String> args = new ArrayList<String>();
    args.add("dailysensordata");
    args.add("SIM_KAHE_6");
    args.add("day");
    args.add("2009-10-25");

    DailySensorData commandDSD = new DailySensorData();
    String testOutput = commandDSD.doCommand(args);

    System.out.println("Testing output of dailysensordata on "
        + "source \"SIM_KAHE_6\" on day \"2009-10-25\"");
    assertTrue(
        "Testing beginning of dailysensor command on source \"SIM_KAHE_6\" on day \"2009-10-25\"",
        testOutput.contains("2009-10-25T00:00:00.000-10:00"));
    assertTrue(
        "Testing tail end of dailysensor command on source \"SIM_KAHE_6\" on day \"2009-10-25\"",
        testOutput.contains("2009-10-25T23:45:00.000-10:00"));

  }

}
